package org.fxml.text {
	import org.fxml.utils.TextFieldUtils;

	import flash.text.TextField;
	import flash.text.TextFormat;

	/**
	 * @author jordandoczy
	 */
	public class TextField extends flash.text.TextField implements ITextField{
		
		protected var _autoEmbed:Boolean = true;
		
		public function TextField(){
			super();
		}
		
		public override function set defaultTextFormat(value:TextFormat):void{
			super.defaultTextFormat = value;
			
			if(autoEmbed) TextFieldUtils.setEmbedFont(this);
		}
		
		public function get autoEmbed() : Boolean {
			return _autoEmbed;
		}
		
		public function set autoEmbed(value : Boolean) : void {
			_autoEmbed = value;
		}
	}
}
